package com.yuju.login.enums;
/**
 * 
 * 类名：RoleMenuReturnCodeEnum  <br />
 *
 * 功能：
 *
 * @author : zhousc <br />
 * @Date : 2017年12月4日 上午10:39:59  <br />
 * @version : 1.1 <br />
 */
public enum RoleMenuReturnCodeEnum {
	ROLEMENU_QUERY_SUCCESS("yuju-roleMenu-1000", "角色菜单权限查询成功"),
	ROLEMENU_QUERY_FAILURE("yuju-roleMenu-1001", "角色菜单权限查询失败"),
	ROLEMENU_SAVE_SUCCESS("yuju-roleMenu-1002", "角色菜单权限保存成功"),
	ROLEMENU_SAVE_FAILURE("yuju-roleMenu-1003", "角色菜单权限保存失败"),
	ROLEMENU_UPDATE_SUCCESS("yuju-roleMenu-1004", "角色菜单权限更新成功"),
	ROLEMENU_UPDATE_FAILURE("yuju-roleMenu-1005", "角色菜单权限更新失败"),
	ROLEMENU_DEL_SUCCESS("yuju-roleMenu-1006", "角色菜单权限删除成功"),
	ROLEMENU_DEL_FAILURE("yuju-roleMenu-1007", "角色菜单权限删除失败");
	
	private String code;
	private String desc;
	
	RoleMenuReturnCodeEnum(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	public static String getDescByCode(String code) {
		for (RoleMenuReturnCodeEnum enume : RoleMenuReturnCodeEnum.values()) {
			if (enume.getCode().equals(code)) {
				return enume.getDesc();
			}
		}
		
		return "未知枚举类型";
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}